package com.bobamrz.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ResourceBundle;

public class ConnectionManager {
	
	public static Connection getConnection() {
		Connection dbConnection = null  ;	
		String password = "";
		String username = "";
		String url = "";

		try {            
			ResourceBundle bundle = ResourceBundle.getBundle("DBConnection");
			Class.forName(bundle.getString("Driver"));
			url = bundle.getString("url");
			username = bundle.getString("username");
			password = bundle.getString("password");
			dbConnection = DriverManager.getConnection(url, username, password);
		}
		catch(Exception ex) {  
			 throw new RuntimeException(ex);
		}
		return dbConnection;
	}

}
